package CH5.Demo3;


import CH5.Demo1.Father;
import CH5.Demo2.Son;

public class TestSon extends TestFather{
    int a;
    int c;
    void print(){
        System.out.println("TestSon print()");
    }
    void print2(){
        System.out.println("TestSon print2()，b="+b);
    }

    public static void main(String[] args) {
        TestSon s=new TestSon();
    /*    System.out.println(s.b);
        System.out.println(s.c);
        s.print1();
        s.print();
        s.print2();
        System.out.println(s.a);*/

        TestFather s2=s;
/*
        System.out.println(s2.a);
        System.out.println(s2.b);
        //System.out.println(s2.c);
        s2.print1();
        s2.print2();
*/
        s2.print();//多态

        s2=new TestSon2();
        s2.print();//多态
    }
}
class TestSon2 extends TestFather{
    void print(){
        System.out.println("TestSon2 print()");
    }
}